package pri.damai.xiaowu.usercenter.api.web;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pri.damai.xiaowu.common.core.vo.ResultVO;
import pri.damai.xiaowu.common.log.anno.XiaoWuLog;
import pri.damai.xiaowu.usercenter.sysauth.application.SysAuthAppService;
import pri.damai.xiaowu.usercenter.vo.OrgVO;

import javax.annotation.Resource;
import java.util.List;

/**
 * 组织机构
 * @Desc
 * @Author yxf
 * @Date 2022/3/26 22:33
 * 但行好事，莫问前程。
 */
@Api(tags = "用户权限")
@XiaoWuLog
@RestController
@RequestMapping("org")
public class OrgController {

    @Resource
    SysAuthAppService authAppService;

    @PostMapping("/getTree")
    public ResultVO<List<OrgVO>> getTree() {
        return ResultVO.success(authAppService.getOrgTree());
    }

}
